package com.qingge.springboot.controller;

import com.qingge.springboot.service.IStuService;
import com.qingge.springboot.service.ISubjectService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/total")
public class TotalController {

    @Resource
    private IStuService stuService;

    @Resource
    private ISubjectService subjectService;

    @GetMapping("/count1")
    public Integer count1() {
        return stuService.getStudentCount();
    }

    @GetMapping("/count2")
    public Integer count2() {
        System.out.println("课程数量:"+subjectService.getSubjectCount());
        return subjectService.getSubjectCount();
    }
}
